package io.xiyou.goods.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.xiyou.goods.dao.model.Goods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Repository
public interface GoodsMapper extends BaseMapper<Goods> {

    /**
     * 减库存
     *
     * @param goodsId
     * @param count
     * @param updateBy
     * @param updateDate
     * @return
     */
    int subtractInventory(@Param("goodsId") Long goodsId, @Param("count") Integer count,
                          @Param("updateBy") String updateBy, @Param("updateDate") Date updateDate);

}